关于"form子句语法错误"的asp问题

来源:百度知道 编辑:UC知道 时间:2024/05/23 18:48:49
<%
Dim ConnStr,myConn,mySQL,myRes
dim myID,myPass,mytype,myAdd,myTel,mymail

ConnStr="Provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("coffee.mdb")
Set myConn=Server.CreateObject ("ADODB.Connection")
Myconn. ConnectionString=ConnStr
myConn.open '直接打开数据库连接

myID=request.form("login") '用户名
myPass=request.form("passwd") '密码
mytype=request.form("UserType") '卡类
myAdd=request.form("address") '开户地点
myTel=request.form("cellphone") '联系电话
mymail=request.form("mail") '电子邮箱

'查询该ID是否存在
mySQL="select * from user where u_user='" & myID & "'"
set myRes=myConn.execute(mySQL)

if myRes.bof and myRes.eof then

'定义一个Insert的SQL语句,向caffee.mdb的user数据库表插入一条记录
mySQL="insert into user (u_user,u_code,u_type,u_addre

user是关键字,使用时要加[]
select * from [user] where u_user=''

Microsoft JET Database Engine (0x80040E14)是指无法进行指定的数据库操作,引起的原因大部分属于语法错误,此处应该是表名和数据库的系统关键字重复,使用是应加[user].建议创建数据库对象的时候,尽量避免使用系统保留关键字来作为表名,字段名,储过程名,视图名等.